<script>
import store from './store';
export default {
	onLaunch: function() {
		this.geturl();

		uni.getSystemInfo({
			success: function(res) {
				store.commit('setSystemInfo', res);
			}
		});
	},
	methods: {
		geturl() {
			uni.$u.http
				.get('/shop/pic/geturl', {})
				.then(res => {
					let url = res.msg;
					store.commit('setBasicsUrl', url);
					this.getaddons();
				})
				.catch(err => {});
		},
		getaddons() {
			uni.$u.http
				.get('/madmin/addons', {})
				.then(res => {
					let addons = res.msg;
					store.commit('setAddons', addons);
					this.getagentrank();
				})
				.catch(err => {});
		},
		getagentrank() {
			uni.$u.http
				.get('/madmin/agent/rank', {})
				.then(res => {
					let agentrank = res.msg;
					store.commit('setAgentrank', agentrank);
					this.$isResolve();
				})
				.catch(err => {});
		}
	},
	onShow: function() {},
	onHide: function() {}
};
</script>

<style lang="scss">
/*每个页面公共css */
@import '@/uni_modules/uview-ui/index.scss';
@import 'common/demo.scss';
@import 'common/iconfont/iconfont.css';
</style>
